<?php
/**
 * Time 时间相关
 * Created by Veyron
 * motto:现在的拼搏 为了更好的明天
 * day:  2020/1/21
 * Time: 22:16
 */
declare(strict_types=1);
namespace app\common\lib;

class Time
{
    /**
     * 登录token保存时间
     * @param int $type
     * @return float|int
     */
    public static function getLoginExpiresTime(int $type = 2) :int {
        $type = in_array($type,[1,2]) ? $type : 2;
        if($type == 1){
            $day = 7;
        }else{
            $day = 30;
        }
        return $day * 24 * 3600;
    }
}
